import request from "@/utils/request";
//评估模型，暂存模型 模型node表-通过状态查询(1=暂存 2=评估模型导入 )
// status
export function getModelByStatus(data) {
    return request({
      url: '/eisEvaluationModelNode/getModelPageByStatus',
      method: 'get',
      params: data
    })
}
/**
 *
 * @param { 2 } status
 * @param { string } startTime
 * @param { string } endTime
 * @param { string } name
 * @param { string } type
 * @returns
 */
//指标体系导入列表
export function eisIndicatorSystem(data) {
    return request({
      url: '/eisIndicatorSystem/list',
      method: 'get',
      params: data
    })
}
//模型优化训练，优化后指标
export function modelOptimizationTraining(data) {
  return request({
    url: '/eisEvaluationModelHisdetail/modelOptimizationTraining',
    method: 'get',
    params: data
  })
}
//训练数据选择
export function taskIdList(data) {
  return request({
    url: '/eisEvaluationModelHisdetail/taskIdList',
    method: 'get',
    params: data
  })
}

//  暂存/模型构建获取树
// export function queryById(id) {
//     return request({
//       url: '/eisEvaluationModelNode/queryById?id='+id,
//       method: 'get',
//     })
// }

//  页面模型暂存
/**
 *
 * @param {string} id 最大树根节点id
 * @param {string} polymerizationAlg 指标聚合设置
 * @returns  {Object}
 */
export function indicatorSet(data) {
    return request({
      url: '/eisEvaluationModelNode/indicatorSet',
      method: 'post',
      data: data
    })
}
// 暂存模型列表删除
export function deleteById(params) {
  return request({
    url: "/eisEvaluationModelNode/deleteById",
    method: "delete",
    params,
  });
}
// 获取树结构的叶子结点
export function deleteModel(params) {
  return request({
    url: "/eisEvaluationModelNode/delete",
    method: "delete",
    params,
  });
}
// 根据模型ID获取模型树
export function selectModelTreeById(id) {
    return request({
      url: '/eisEvaluationModelNode/selectModelTreeById?id='+id,
      method: 'get',
    })
}
// 模型评估根据模型ID获取模型树
export function selectModelTreeByIdNew(id) {
  return request({
    url: '/eisEvaluationModelNode/selectModelTreeByIdNew?id='+id,
    method: 'get',
  })
}
//  指标体系获取树
export function queryModelById(id) {
  return request({
    url: '/eisIndicatorSystem/queryModelById?id='+id,
    method: 'get',
  })
}
// 暂存
export function saveModelNode(data) {
  return request({
    url: '/eisEvaluationModelNode/saveModelNode',
    method: 'post',
    data: data,
  })
}
// 检验
export function checkModelNode(data) {
  return request({
    url: '/eisEvaluationModelNode/checkModelNode',
    method: 'post',
    data: data,
  })
}
// 一致性检验
export function labCalc(data) {
  return request({
    url: '/eisEvaluationModelNode/labCalc',
    method: 'post',
    data: data,
  })
}
// 获取树结构的叶子结点
export function getModelNodeList(data) {
  return request({
    url: '/eisEvaluationModelNode/getModelNodeList',
    params: data,
    method: 'get',
  })
}

// 获取算法列表
export function computedlist() {
  return request({
    url: "/cloudiip/lab/list?search=",
    method: "get",
  });
}
